package com.wjc.homework.homework03;

/**
 * @author wang'ji'cheng
 * @date 2025/7/12
 */
public class Book {
   private String name;
   private double price;

   public Book(String name, double price) {
       this.name = name;
       this.price = price;
   }
   public void updatePrice(){
       if (this.price > 150){
            this.price = 150;
       }else if(this.price>100){
           this.price = 100;
       }
   }

    public static void main(String[] args) {
        Book book = new Book("book", 99);
        book.updatePrice();
        System.out.println(book.price);
    }
}
